/*
 * @Date: 2020-11-24 21:28:39
 * @LastEditors: 小枫
 * @description: description
 * @LastEditTime: 2020-11-26 20:53:04
 * @FilePath: \stu-nest\src\main.ts
 */
import { NestFactory } from '@nestjs/core';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { AppModule } from './app.module';
// import { RolesGuard } from './common/guards/roles.guard';
// import { HttpExceptionFilter } from './common/filter/http-exception.filter';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  // app.useGlobalFilters(new HttpExceptionFilter());

  // app.useGlobalGuards(new RolesGuard());

  const options = new DocumentBuilder()
    .setTitle('Nest RESTful API')
    .setDescription('接口文档')
    .setVersion('1.0')
    .addBearerAuth()
    .build();
  const document = SwaggerModule.createDocument(app, options);
  SwaggerModule.setup('doc', app, document);

  await app.listen(3000);
}
bootstrap();
